#pragma once
#ifndef AWF_COMPARISON_H
#define AWF_COMPARISON_H

#include "aw_image.h"
#define MAX_SIMILAR_NUM 50

#ifdef __cplusplus
extern "C"
{
#endif //__cplusplus

	typedef struct _awf_face_database AWF_Face_Database;  // _awf_ _AllWinnerFace_

	struct _awf_face_database
	{
		int n;
		int feat_dim;
		float **feat_list;

		int(*add_unit)(AWF_Face_Database *, float *);
		void(*release)(AWF_Face_Database *);
	};

	typedef struct _awf_comparison_container AWF_Comparison_Container;
	struct _awf_comparison_container
	{
		int feat_dim;
		float thresh;

		void *exfeat_container;
		void *align_container;
		void *history;
	};


	int awf_make_comparison_container(AWF_Comparison_Container *container, 
		AWF_Face_Database *face_database, 
		int feat_dim, float thresh, char *model_path);

	int awf_run_face_comparsion(AWF_Comparison_Container *container,
		AWF_Face_Database *face_database, AW_Img *img, 
		AW_Box *face_box, AW_LDMK *ldmk, float *feat,
		int *count, int *indices, float *dists);

	void awf_free_comparison_container(AWF_Comparison_Container *container,
		AWF_Face_Database *face_database);

#ifdef __cplusplus
}
#endif

#endif //  AWF_COMPARISON_H